<?php
include '../config/config.php';
include '../lib/produk.php';

$config=new config();
$config->connect();
session_start();
if (!isset($_SESSION['MM_Username'])){
	$togo="../login.php";
	header ("Location:$togo");
}
$Promo_Dao=new Produk_Dao();
$data=$Promo_Dao->get_idmember($_SESSION['MM_Id']);


?>
<?php include("header_member.php") ?>
<?php include("menu_kiri_member.php") ?>

<div id="body">
<div class="topbox">
                  Daftar Produk:
                  <br>
				  <br>
                  <table border=1 cellspacing=0 cellpadding=4>
				  <tr>
					<th>No</th>
					<th>Nama Produk</th>
					<th>Jumlah</th>
					<th>Fasilitas</th>
					<th>Harga</th>
					<th>keterangan</th>
					<th></th>
					
				  </tr>
				  
				  <?php
				  $i=1;
				  foreach($data as $dt){
					$Produk_Dao=new Produk_Dao();
					$produk=$Produk_Dao->get_id($dt->id_produk);
				  ?>
				  
				   <tr>
					<td><?php echo $i; ?></td>
					<td><?php echo ucwords($produk->nama_produk); ?></td>
					<td><?php echo $produk->jumlah; //echo number_format($produk->jumlah, 2, '.', ','); ?> Kamar</td>
					<td><?php echo $dt->fasilitas; ?></td>
					<td><?php echo number_format($produk->harga, 2, '.', ','); ?></td>
					<td><img src="images/produk/<?php echo $dt->foto_produk; ?>"></td>
					<td> 
					<?php echo "<a href=\"ubah_produk.php?id=$dt->id_produk\">";
					echo "ubah</a> ";
					echo " ";
					echo "<a href=\"hapus_produk.php?id=$dt->id_produk\" onclick=\"return del()\">";
					echo "hapus </a>";
					?>
					</td>
					
				  </tr>
				  <?php $i++;}?>

				  
				  </table>
				  <br/>
                  <input type="button" value=" Tambah " onClick="window.location.href='tambah_produk.php'">
                  
	                  
</div>             
</div>
          
         <div class="clear"></div>
         <?php include("../footer.php") ?>
		